<style lang="less" scoped>
    .log-box{
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        background: #f0f0f0;
        .log-box_address{
            width: 100%;
            background: #fff;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            padding: 12px 19px 22px;
            box-sizing: border-box;
            font-size: 14px;
            height: 98px;
            position: relative;
            border-top: 1px solid #e5e5e5;
            >img{
                width: 100%;
                height: 3px;
                bottom: 0px;
                left: 0;
                right: 0;
                position: absolute;
            
            }
        }
        .log-box_code{
            width: 100%;
            height: 60px;
            line-height: 60px;
            color: #fff;
            font-size: 15px;
            padding: 0 20px;
            display: flex;
            margin-top: 12px;
            align-items: center;
            background: #7A1634;
            position: relative;
            z-index: 20;
            .copy-tet{
                right: 32%;
                font-size: 12px;
                top: 0px;
                position: absolute;
            }
            .copy-btn{
                width: 56px;
                height: 21px;
                margin-left: 23px;
                text-align: center;
            }
        }
        .log-box_info{
            width: 100%;
            flex: 1;
            height: 100%;
            display: flex;
            flex-direction: column; 
            box-sizing: border-box;
            .info-bg{
                width: 100%;
                height: 62px;
                background: #7A1634;
                border-bottom-right-radius:20px;
                border-bottom-left-radius:20px; 
            }
            .info-tit{
                padding: 10px;
                border-radius: 5px;
                margin-top: -80px;
                flex: 1;
                overflow: auto;
                box-sizing: border-box;
                ul{
                    background: #fff;
                    width: 100%;
                    min-height: 100%;
                    padding-top: 42px;
                    padding-left: 42px;
                    padding-bottom: 27px;
                    box-sizing: border-box;
                   
                    li{
                        width: 100%;
                        display: flex;
                        -webkit-box-pack: center;
                        -ms-flex-pack: center;
                        -webkit-box-align: center;
                        position: relative;
                        overflow: hidden;
                        
                        &:after{
                            position: absolute;
                            content: "";
                            height: 100%;
                            width: 1px;
                            left: 5%;
                            -webkit-transform: translatex(-50%);
                            transform: translatex(-50%);
                            top: 0%;
                            z-index: 10;
                            background: #d2d2d2;
                        }
                        &:last-child:after{
                            background: #fff;
                        }
                        
                        .recordCircle{
                            margin: 0 10px;
                            width: 15px;
                            height: 15px;
                            border-radius: 80px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            position: absolute;
                            left: -2px;
                            border: 1px solid #fff;
                            z-index: 11;
                            background: #f0f0f0;
                            >img{
                                width: 15px;
                                height: 15px;
                                z-index: 12;
                            }
                        }
                        .current{
                            >span{
                                width: 15px;
                                height: 15px;
                                z-index: 12;
                                border-radius: 500px;
                            }
                        }
                        
                        .recordContent{
                            margin-left:40px;
                            padding-right: 20px;
                            min-height: 20px;
                            width: 100%;
                            line-height: 20px;
                            font-size: 15px;
                            display: flex;
                            position: relative;
                            flex-direction: column;
                            align-items: flex-start;
                            justify-content: center;
                            .recordContent_time{
                                font-size: 15px
                            }
                            .recordContent_msg{
                                width: 100%;
                                height: 20px;
                                display: flex;
                                flex-direction: column;
                                font-size: 12px;
                                justify-content: center;
                                
                            }
                            .current-height{
                                 height: 80px;   
                            }
                        }
                        
                        
                    }
                    .tar-color{
                        color: #7A1634;
                        font-size: 12px;
                    }
                }
            }
        }
        .fIcon{
            width: 10px;
            height: 6px;
            vertical-align: middle;
            margin-left: 12px;
        }
        .recordContent_time{
            width: 100px;
            position: relative;
            img{
                position: absolute;
                right: 20px;
                top: 8px;
            }
        }
    }
</style>
<template>
    <div class="log-box">
        <div class="log-box_address">
            <span class="text-gray MB-10">收货地址</span>
            <span class="text-black MB-5">小穿穿 155151516556</span>
            <span class="text-black">广东 深圳市 南山区 茂业时代广场 24c</span>
            <img :src="aBorder"/>
        </div>
        <div class="log-box_code">
            <span>订单号：1651561616161616</span>
            <img :src="copyIcon" class="copy-btn" @click="coppCode " />
            
        </div>
        <div class="log-box_info">
            <div class="info-bg"></div>
            <div class="info-tit">
                <ul>
                    <li v-for="(item, index) in list" :key="index">
                        <div class="recordCircle"  @click="showItem(item)" :class="{'current':item.select}">
                            <!-- <span></span> -->
                            <img :src="currentIcon" v-if="item.select"/>
                            <img :src="curIcon" v-else/>
                        </div>
                        <div class="recordContent" >
                            <div  class="recordContent_time" @click="showItem(item)" :class="{'tar-color':item.select,'text-gray':!item.select}">
                                {{item.title}}
                                <img class="fIcon" :src="icon_put" v-if="item.select"/>
                                 <img class="fIcon" :src="icon_drop" v-else/>
                            </div>
                            <div class="recordContent_msg" :class="{'current-height':item.select}"  v-for="(cel , childIndex) in item.summary" :key="childIndex">
                                <span class="text-gray" v-if="item.select">{{cel.time}}</span>
                                <span v-if="item.select" :class="{'tar-color':item.select,'text-gray':!item.select}">{{cel.desc}}</span>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>
<script>
import aBorder from '@/assets/images/logistics/a-border.png'
import copyIcon from '@/assets/images/logistics/copy.png'
import currentIcon from '@/assets/images/logistics/current.png'
import curIcon from '@/assets/images/logistics/cur.png'
import icon_drop from '@/assets/images/logistics/icon_drop@2x.png'
import icon_put from '@/assets/images/logistics/icon_put@2x.png'
export default {
    title:'订单跟踪',
    data(){
        return {
            aBorder:aBorder,
            copyIcon:copyIcon,
            currentIcon:currentIcon,
            curIcon:curIcon,
            icon_put:icon_put,
            icon_drop:icon_drop,
            list:[
                {
                    'select':true,
                    'title':'确认收款',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收'
                        }
                    ]
                },
                {
                    'select':false,
                    'title':'待取件',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        }
                    ]
                },
                {
                    'select':false,
                    'title':'派送中',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        }
                    ]
                },
                {
                    'select':false,
                    'title':'运输中',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        }
                    ]
                },
                {
                    'select':false,
                    'title':'已发货',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        }
                    ]
                },
                {
                    'select':false,
                    'title':'付款时间',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        }
                    ]
                },
                {
                    'select':false,
                    'title':'下单时间',
                    'summary':[
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        },
                        {
                            'time':'2018-05-20    15：23：25',
                            'desc':'已签收人人人人人'
                        }
                        
                    ]
                },
                
            ]
        }
    },
    methods:{
        coppCode(){
            wx.showToast({
                icon:'none',
                title:'复制成功'
            })
        },
        showItem(item){
            this.list.forEach((element) => {
                element.select = false
            })
            item.select = true
        }
    }
}
</script>

